home *** CD-ROM | disk | FTP | other *** search
- Path: foghorn.llnl.gov!lehman
- From: lehman@foghorn.llnl.gov (Sean Lehman @ IDP)
- Newsgroups: comp.lang.c++
- Subject: g++ problem: const foo& VS foo&
- Date: 15 Feb 1996 16:39:28 GMT
- Organization: Lawrence Livermore National Laboratory
- Message-ID: <4fvnk0$5cm@lll-winken.llnl.gov>
- NNTP-Posting-Host: foghorn.llnl.gov
- X-Newsreader: Tin 1.1 PL3
-
- g++ objects to these declarations:
-
- friend int& ndimof( SIGNAL&a ) { return a.NDim ;}
- friend int ndimof( const SIGNAL&a ) { return a.NDim ;}
-
- with this complaint:
-
- ./src/Signal.c:3751: call of overloaded `ndimof' is ambiguous
- ./src/Signal.h:391: candidates are: ndimof(const SIGNAL &)
- ./src/Signal.h:390: ndimof(SIGNAL &)
-
-
- According to the ARM, Chapter 13, for any type T,
-
- "... it is possible to distinguish between const T&, volatile
- T&, and plain T& so functions that differ only in this
- respect may be defined."
-
- So what is the problem with g++?
- --
-
- +------------------------------------------------------------------------+
- | Sean K. Lehman, lehman2@llnl.gov |
- | Lux et Veritas |
- | Anyone can fall out of an airplane, skydivers just do it right. |
- | "Looking toward the sky waiting for my next operating instructions." |
- | -Anne Lamott |
- +------------------------------------------------------------------------+
-